<template>
	<view>
		<view class="input" style="margin: 30rpx;">
			
			<uni-forms ref="form" :rules="{}" :model="user">
				
				<uni-forms-item label="用户名" name="">
					<uni-easyinput v-model="user.username" placeholder="请输入用户名" />
				</uni-forms-item>
				
				<uni-forms-item label="密码" name="">
					<uni-easyinput  v-model="user.password" placeholder="" />
				</uni-forms-item>
				
				<uni-forms-item label="学院" name="" >				
					<uni-combox 
					label="" 
					:candidates="user.college"
					placeholder="请选择学院" v-model="user.colleges"></uni-combox>				
				</uni-forms-item>
				
			<uni-forms-item label="专业" name="">
				<uni-combox label="" 
				:candidates="user.major"
				 placeholder="请选择专业" 
				 v-model="user.majors"></uni-combox>
			</uni-forms-item>
			
			<uni-forms-item label="电话" name="">
				<uni-easyinput  v-model="user.phone" placeholder="请输入电话" />
			</uni-forms-item>
			
			<uni-forms-item label="姓名" name="">
				<uni-easyinput  v-model="user.name" placeholder="请输入姓名" />
			</uni-forms-item>
				
				<uni-forms-item label="邮箱" name="">
					<uni-easyinput  v-model="user.email" placeholder="请输入邮箱" />
				</uni-forms-item>
				
				<uni-forms-item label="" name="">
					<button type="primary" @click="register">注册</button>
				</uni-forms-item>
			</uni-forms>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:{
					username:'DYL',
					password:'123',
					colleges:'',
					college:['信息工程学院','经济管理学院','智能制造学院'],
					majors:'',
					major:['软件技术','移应开发','大数据'],
					phone:'1377777777',
					name:'邓雅丽',
					email:'1888888888'
				}
			}
		},
		methods: {
			collegeChange(e){
				this.colleges = e.detail.value
			},
			majorChange(e){
				this.majors = e.detail.value
			},
			register(e) {
				console.log('' + this.user.username + '\r' + this.user.colleges + '\t' +
						this.user.majors + '\t' + this.user.phone + '\t' +
						this.user.name + '\t' +
						this.user.email);
	
			}
		}
	}
</script>

<style>

</style>